package com.zk.springbootdemo.controller;

import com.zk.springbootdemo.domain.Enterprise;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/books")
public class BookController {
   @Autowired
    private Environment environment;
   @Autowired
   private Enterprise enterprise;
    @RequestMapping("/{id}")
    public String getById(@PathVariable Integer id){
        System.out.println("id=>"+id);
        System.out.println("getName "+enterprise.getName());
        System.out.println("getTel "+enterprise.getTel());
        System.out.println("getAge "+enterprise.getAge());
        System.out.println("getSubject "+enterprise.getSubject()[0]);
        return "hello springboot!";

    }
}
